<template>
  <section>
    <!-- <div class="model retrieval">
      <img :src="IMGBASE64.JIANSUOGUANLI2X" class="orange">
      <span class="title">检索管理</span>
      <div class="body">
        <span>职位:</span>
        <input type="text" placeholder="请输入职位名称" v-model="teaName">
        <el-button type="primary" @click="nameSearch" size="small">搜索</el-button>
      </div>
    </div> -->

    <div class="model list">
      <img :src="IMGBASE64.XIAOCHEXIANLU2X" class="pink">
      <span class="title">职位列表</span>
      <div class="kong"></div>
      <el-table :data="tableData" style="100%">
          <el-table-column prop="id" label="#" align="center"></el-table-column>
          <el-table-column prop="departName" label="部门名称" align="center"></el-table-column>
          <el-table-column prop="position" label="职位名称" align="center"></el-table-column>
          <el-table-column label="操作" align="center">
            <template scope="scope">
              <el-button size="small" @click="append(scope.row, $event)">OA权限</el-button>
              <el-button size="small" @click="append2(scope.row, $event)">移动端权限</el-button>
            </template>
          </el-table-column>
        </el-table>
    </div>

  </section>
</template>

<script>
// const cityOptions = ['上海', '北京', '广州', '深圳']
export default {
  data () {
    return {
      player: '凹凸鳗',
      upShow: false,
      Enline: null,
      teaName: null,
      line: null,
      lineOption: [],
      tableData: []
    }
  },
  methods: {
    upshow () {
      this.upShow = !this.upShow
    },
    append (row, ev) {
      // store.append({ code: code++, label: 'testtest', children: [] }, data)
      // this.upShow = true
      this.$router.push({path: '/schoolConf/OAManagement', query: { 'positionId': row.positionId }})
      // console.log(row)
    },
    append2 (row, ev) {
      // store.append({ code: code++, label: 'testtest', children: [] }, data)
      // this.upShow = true
      this.$router.push({path: '/schoolConf/YDDManagement', query: { 'positionId': row.positionId }})
    },
    nameSearch () {},
    handleCheckAllChange (item) {
      var index = this.powerlist.indexOf(item)
      this.powerlist[index].isIndeterminate = false
      if (this.powerlist[index].checkAll === true && this.powerlist[index].isIndeterminate === false) {
        this.powerlist[index].checkedCities = this.powerlist[index].cities
      } else {
        this.powerlist[index].checkedCities = []
      }
      // this.checkedCities = event.target.checked ? cityOptions : []
      // this.isIndeterminate = false
    },
    handleCheckedCitiesChange (item) {
      var index = this.powerlist.indexOf(item)
      // console.log(this.powerlist.indexOf(item))
      let checkedCount = this.powerlist[index].checkedCities.length
      this.powerlist[index].checkAll = checkedCount === this.powerlist[index].cities.length
      this.powerlist[index].isIndeterminate = checkedCount > 0 && checkedCount < this.powerlist[index].cities.length
    }
  },
  mounted () {
    // let _cookie = document.cookie.split(';')
    // let _cookieArray = []
    // _cookie.forEach(v => {
    //   let _d = v.split('=')
    //   _cookieArray.push({
    //     key: _d[0],
    //     value: _d[1]
    //   })
    // })
    this.$http.post(this._httpUrl + 'schoolConf/position/manage/positionList', {}, {'headers': {'yxt-xtoken': localStorage.xtoken}}).then(function (response) {
      if (response.body.code === '000') {
        this.tableData = response.data.data
      } else if (response.body.code === '887') {
        this.$router.push('/')
      } else if (response.body.code === '889') {
        this.$router.push('/')
      }
    })
    // this.$http.post('http://119.23.36.128:8020/yxt-web/workApproval/type', {}, {'headers': {'yxt-xtoken': _cookieArray[0].value}}).then(function (response) {
    //   if (response.body.code === '000') {
    //     // console.log(response.data.data)
    //     this.lineOption = response.data.data
    //   } else {
    //     this.$route.push('/login')
    //   }
    // })
  }
}
</script>

<style lang="less" scoped>
@import '/static/css/all-use.css';
  .retrieval{
    .body{
      span{
        margin-left: 4%;
      }
      span:first-child{
        margin-left: 0;
      }
      .firstSelect{
        width: 15%;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
      }
      .select{
        width: 10%;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
      }
      input{
        margin-left: 4%;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
      }
    }
  }
</style>

<style scoped>
  div[data-v-22bf8d34] ul
  {
    position: relative;
    left: 12%;
  }
  div[data-v-22bf8d34]
  {
    padding-bottom: 10px;
  }
  .el-upload--picture-card
  {
    margin-left: 9%; 
    margin-top: 40px;
    width: 80px; height: 80px;
  }
  .el-upload--picture-card i
  {
    position: relative; top: -28px;
  }
  .tree{
    position: relative; left: 60%;
    width: 40%;
  }
  .span{
    opacity: 0;
  }

  .up{
    width: 60%;
    position: absolute;
    top: 10%;
    left: 25%;
    background: #FFF;
    padding: 20px 20px 0 20px;
    border-radius: 5px;
    z-index: 99999;
  }
  .up .orange{
    position: absolute;
    left: 24px;
    top: -25px;
  }
  .up .img{
    position: absolute;
    left: 24px;
    top: -20px;
  }
  .up .title{
    margin-left: 90px;
  }
  .up header{
    border-bottom: 2px solid #D7D7D7;
    padding: 30px 0 10px 0;
    margin-left: 1%;
    margin-right: 10px;
    margin-bottom: 10px;
  }
  .up .header-title{
    color: #FB7862;
    border-bottom: 2px solid #FB7862;
    padding: 0 10px 10px 10px;
    margin-left: 0;
  }
  .up .form{
    margin-left: 10%;
    margin-right: 10px;
    overflow: hidden;
  }
  .up .form ul li{
    margin-right: 8%;
    margin-bottom: 4%;
  }
  .up .form .firstLine{
    padding: 30px 0 10px 0;
  }
  .up .form .secondLine{
    padding: 30px 0 50px 0;
  }
  .up .form .form-longText{
    width: 50%;
    border: 0;
    border-bottom: 1px solid #D7D7D7;
  }
  .up .form .form-text{
    width: 70%;
    border: 0;
    border-bottom: 1px solid #D7D7D7;
  }
  .up ul{
    margin-top: 30px;
    margin-left: 75px;
  }
  .up ul li{
    float: left;
  }
  .up .bottom{
    border-top: 1px solid #D7D7D7;
    margin-top: 20px;
    background: #F8F8F8;
    padding: 8px 0;
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0 0 5px 5px;
  }
  .up .bottom .right{
    text-align: right;
    padding: 0 10px 0 0;
  }
</style>
